<template>
  <el-form>
    <el-form-item>
      请设置支付密码：
      <el-input v-model="kai.payPassword" placeholder="支付密码"></el-input>
      再次输入支付密码：
      <el-input v-model="kai.payPasswords" placeholder="支付密码"></el-input>
      <el-button type="primary" @click="zhuanzhangs">确定设置</el-button>
    </el-form-item>
  </el-form>
</template>

<script setup>
import { ref, reactive } from 'vue'
import { payPassword } from '@/api/open'
import { ElMessage } from 'element-plus'
const kai = reactive({})
function zhuanzhangs() {
  if (kai.payPassword === kai.payPasswords) {
    console.log(kai)
    payPassword(kai).then(res => {
      console.log(res)
      ElMessage({
        message: '设置成功',
        type: 'success',
      })
      // window.location.href = 'bank'
    })
  } else {
    ElMessage.error('两次不一致')
  }
}
</script>

<style scoped></style>
